package com.yuelife.controller;

import com.yuelife.pojo.Buygoodtype;
import com.yuelife.service.BuygoodTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author by Rxzeg
 * @date 2020-06-12 15:09
 * @describe
 */
@Controller
@CrossOrigin
@RequestMapping("/type")
public class BuyGoodController {
    @Autowired
    private BuygoodTypeService service;
    @GetMapping(value ="/list")
    @ResponseBody
    public Map selectAllType(){
       Map map=new HashMap();
        List<Buygoodtype> lists=service.selectAll();
        map.put("list",lists);
        return map;
    }
}
